Agilepy science API tutorial - VELA Region analysis

The purpose of this notebook is to show how to use the Agilepy scientific API.

The complete API documentation can be found at this link.

Importing the library

Creating a configuration file

Initialization of the class

API: configuration file

Print all options of the configuration file

Print a single section of the yaml configuration file

Print a single option

Set some options

API: interacting with the Sources Library

Loading the AGILE's second catalogue of gamma-ray sources

Alternative solution: loading the sources from a custom AGILE .txt file

The sources that are already present in the Sources Library will not be loaded twice.

Selecting the sources

The selection criteria can be expressed using the following Source class’s parameters:

Free/Fix source parameters

You can fix or free the following parametes:

Resetting the changes:

Deleting sources

Adding a source

Passing a dictionary:

Passing a Source object:

Update the value of a spectrum parameter of a source

Fix the hypothesis for the analysis

This method returns the selected sources affected by the change

Final source hypothesis for the analysis

API: generate maps and perform maximum likelihood estimator analysis

Generating maps

Displaying maps

Single figure - multiple subplots

Multiple figures - one subplot per figure

Saving maps

Estimation of background coefficients

You can use the calcBkg() method to estimate the background coefficients.

Maximum likelyhood analysis

Free also position parameter

Save the results of the analysis in a reg file.

Display the result of the analysis saved in a reg file.

Light curve

Fix the position and keep only flux free

time_start_mjd time_end_mjd sqrt(ts) flux flux_err flux_ul gal gal_error iso iso_error l_peak b_peak dist_peak l b r ell_dist a b phi exposure ExpRatio counts counts_err Index Index_Err Par2 Par2_Err Par3 Par3_Err Erglog Erglog_Err Erglog_UL time_start_utc time_end_utc time_start_tt time_end_tt Fix index ULConfidenceLevel SrcLocConfLevel start_l start_b start_flux typefun par2 par3 galmode2 galmode2fit isomode2 isomode2fit edpcor fluxcor integratortype expratioEval expratio_minthr expratio_maxthr expratio_size Emin emax fovmin fovmax albedo binsize expstep phasecode

Aperture Photometry

Cleaning up